use std::io;
use std::fs::File;
use std::io::Read;
fn read(path:&str)->Result<String,io::Error>{
    let mut f=File::open(path)?;
    let mut s=String::new();
    f.read_to_string(&mut s)?;
    Ok(s)
}
pub fn main() {
    let str_file=read("kind.rs");
    match str_file{
        Ok(s)=>{
            println!("{}",s);
        },
        Err(e)=>{
            match e.kind(){
                io::ErrorKind::NotFound=>{
                    println!("NotFound");
                },
                _=>{
                    println!("can not read");
                }
            }
        }
    }
}

